package Homework0811;

import java.util.Random;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        char[] VerCode=new char[4];
        Random rand=new Random();

        String RandomStr="0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
        for(int i=0;i<VerCode.length;i++){
            int randIndex=rand.nextInt(RandomStr.length());
            VerCode[i]=RandomStr.charAt(randIndex);
        }

        LowerArr lowercode=new LowerArr(VerCode);
        System.out.println(lowercode);

        Scanner sc=new Scanner(System.in);
        String input=sc.nextLine();
        char[] inputChar=input.toCharArray();
        LowerArr inputLower=new LowerArr(inputChar);
        System.out.println(inputLower);

        if(lowercode.equals(inputLower))
            System.out.println("输入正确");
        else
            System.out.println("验证码错误");
    }
}
